package com.unicorn.util;

import org.slf4j.Logger;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * Created by windy on 16-11-3.
 */
@Component
public class JsonResponse<T> implements Serializable {

    protected int code;

    protected String message;

    protected T  data;


    /**
     * 成功状态码
     */
    public static final int STATUS_OK=0;

    /**
     * 失败状态码
     */
    public static final int STATUS_FAIL=-1;

    /**
     * 请求错误
     */
    public static final int STATUS_BAD_REQUEST=-2;

    public static final String MSG_SUCCESS = "成功";

    public static  final  String MSG_BAD_REQUEST="请求错误";

    public static  final String MSG_FAIL="失败";


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }



}

